<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layouts::header"></head>
<body>
<nav th:replace="layouts::navbar"></nav>

<div class="container-fluid">
    <form th:action="@{/heads/save}" th:object="${head}" method="POST">

        <div class="logo"></div>
        <hr>

        <label for="name">姓名:</label>
        <input type="text" id="name" th:field="${head.name}">
        <span th:if="${#fields.hasErrors('name')}" th:errors="${head.name}"></span>

        <input type="radio" name="sex" id="sex1" value="男" th:field="${head.sex}">
        <span th:if="${#fields.hasErrors('sex')}" th:errors="${head.sex}"></span>
        <label for="sex1">男</label>
        <input type="radio" name="sex" id="sex2" value="女" th:field="${head.sex}">
        <span th:if="${#fields.hasErrors('sex')}" th:errors="${head.sex}"></span>
        <label for="sex2">女</label>


        <label for="phone">电话:</label>
        <input type="text" id="phone" th:field="${head.phone}">
        <span th:if="${#fields.hasErrors('phone')}" th:errors="${head.phone}"></span>

        销售ID：<select multiple="multiple" th:field="*{sales}">
                    <option th:each="sale : ${allSales}" th:value="${sale.saleId}" th:text="${sale.saleId}"></option>
                </select>

        进货ID：<select multiple="multiple" th:field="*{purchases}">
                    <option th:each="purchase : ${allPurchases}" th:value="${purchase.purchaseId}" th:text="${purchase.purchaseId}"></option>
                </select>

        <button type="submit">新增负责人</button>
    </form>
</div>
</body>
</html>